4c9fc9c9523af0f19e93608f87d5eabd4f5a8df1,bergamot-result-processor/src/main/java/com/intrbiz/bergamot/result/DefaultResultProcessor.java,DefaultResultProcessor,computeResultTransition,#RealCheck#CheckState#ResultMO#,446

Before Change


                nextState.setHard(true);
                nextState.setTransitioning(false);
                nextState.setAttempt(check.computeCurrentAttemptThreshold(nextState));
                if (nextState.isAlert()) nextState.setCurrentAlertId(encompassingAlertId == null ? Site.randomId(check.getSiteId()) : encompassingAlertId);
                if (nextState.isRecovery()) nextState.setCurrentAlertId(null);
                return new Transition()
                    .previousState(currentState)
                    .nextState(nextState)
                    .stateChange(true)
                    .hardChange(true)
                    .alert(nextState.isAlert())
                    .recovery(nextState.isRecovery());
            }
            else
            {
                // start the transition
                nextState.setHard(false);
                nextState.setTransitioning(true);
                nextState.setAttempt(1);               
                return new Transition()
                    .previousState(currentState)
                    .nextState(nextState)
                    .stateChange(true)
                    .hardChange(false)
                    .alert(false)
                    .recovery(false);
            }
        }
        else if (currentState.isHard())
        {
            // steady state
            return new Transition()
                .previousState(currentState)
                .nextState(nextState)
                .stateChange(false)
                .hardChange(false)
                .alert(false)
                .recovery(false);
        }
        else
        {
            // during transition
            nextState.setAttempt(currentState.getAttempt() + 1);
            // have we reached a hard state
            if (nextState.getAttempt() >= check.computeCurrentAttemptThreshold(nextState) && ((! hasDependencies) || dependenciesAreAllHard))
            {
                // we can only enter a hard state if we have no dependencies
                // or all the dependencies are in a hard state
                nextState.setHard(true);
                nextState.setTransitioning(false);
                nextState.setAttempt(check.computeCurrentAttemptThreshold(nextState));
                if (nextState.isAlert()) nextState.setCurrentAlertId(encompassingAlertId == null ? Site.randomId(check.getSiteId()) : encompassingAlertId);
                if (nextState.isRecovery()) nextState.setCurrentAlertId(null);
                return new Transition()
                    .previousState(currentState)
                    .nextState(nextState)

After Change


                nextState.setAttempt(check.computeCurrentAttemptThreshold(nextState));
                if (nextState.isAlert())
                {
                    nextState.setCurrentAlertId(encompassingAlertId == null ? Site.randomId(check.getSiteId()) : encompassingAlertId);
                    nextState.setAcknowledged(false);
                }
                if (nextState.isRecovery())
                {
                    nextState.setCurrentAlertId(null);
                    nextState.setAcknowledged(false);
                }
                return new Transition()
                    .previousState(currentState)
                    .nextState(nextState)
                    .stateChange(true)
                    .hardChange(true)
                    .alert(nextState.isAlert())
                    .recovery(nextState.isRecovery());
            }
            else
            {
                // start the transition
                nextState.setHard(false);
                nextState.setTransitioning(true);
                nextState.setAttempt(1);               
                return new Transition()
                    .previousState(currentState)
                    .nextState(nextState)
                    .stateChange(true)
                    .hardChange(false)
                    .alert(false)
                    .recovery(false);
            }
        }
        else if (currentState.isHard())
        {
            // steady state
            return new Transition()
                .previousState(currentState)
                .nextState(nextState)
                .stateChange(false)
                .hardChange(false)
                .alert(false)
                .recovery(false);
        }
        else
        {
            // during transition
            nextState.setAttempt(currentState.getAttempt() + 1);
            // have we reached a hard state
            if (nextState.getAttempt() >= check.computeCurrentAttemptThreshold(nextState) && ((! hasDependencies) || dependenciesAreAllHard))
            {
                // we can only enter a hard state if we have no dependencies
                // or all the dependencies are in a hard state
                nextState.setHard(true);
                nextState.setTransitioning(false);
                nextState.setAttempt(check.computeCurrentAttemptThreshold(nextState));
                if (nextState.isAlert())
                {
                    nextState.setCurrentAlertId(encompassingAlertId == null ? Site.randomId(check.getSiteId()) : encompassingAlertId);
                    nextState.setAcknowledged(false);
                }
                if (nextState.isRecovery())
                {
                    nextState.setCurrentAlertId(null);
                    nextState.setAcknowledged(false);
                }
                return new Transition()
                    .previousState(currentState)